package com.week10.mybatis_annotation;

import com.week10.entity.User;
import com.week10.mapper.selectUser;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class testController {

    @Autowired
    SqlSessionFactory sqlSessionFactory;

    @GetMapping("/selectone")
    public User selectOne(){
        selectUser su = sqlSessionFactory.openSession().getMapper(selectUser.class);
        return su.selectOneUser(100);
    }

}
